<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<#include "/include/head_common.html">
<title>字典<#if dict.id??&&dict.id!=''>修改<#else>添加</#if></title>
<meta name="decorator" content="default" />
<script type="text/javascript">
	$(document).ready(
			function() {
				$("#value").focus();
				$("#inputForm")
						.validate(
								{
									submitHandler : function(form) {
										loading('正在提交，请稍等...');
										form.submit();
									},
									errorContainer : "#messageBox",
									errorPlacement : function(error, element) {
										$("#messageBox").text("输入有误，请先更正。");
										if (element.is(":checkbox")
												|| element.is(":radio")
												|| element.parent().is(
														".input-append")) {
											error.appendTo(element.parent()
													.parent());
										} else {
											error.insertAfter(element);
										}
									}
								});
			});
	function goback(){
    	$.cookie('goback','goback',{path: '/',expires: 1});
    	history.go(-1);
    }
</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="list">字典列表</a></li>
		<li class="active">
			<a href="edit?id=${dict.id!''}">字典<#if dict.id??&&dict.id!=''>修改<#else>添加</#if>
			</a>
		</li>
	</ul>
	<br />
	<form id="inputForm" action="edit" method="post"
		class="form-horizontal form-signin">
		<input type="hidden" name="id" value="${dict.id!''}" />
		<script type="text/javascript">top.$.jBox.closeTip();</script>
		<div class="control-group">
			<label class="control-label">键值:</label>
			<div class="controls">
				<input id="value" name="value" value="${dict.value!''}" maxlength="50"
					class="required"  type="text"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">标签:</label>
			<div class="controls">
				<input name="label" value="${dict.label!''}" maxlength="50"
					class="required"  type="text"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">类型:</label>
			<div class="controls">
				<input name="type" value="${dict.type!''}" maxlength="50"
					class="required abc"  type="text"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">描述:</label>
			<div class="controls">
				<input name="description" value="${dict.description!''}" maxlength="50"
					class="required" type="text"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">排序:</label>
			<div class="controls">
				<input name="sort" value="${dict.sort!''}" maxlength="11"
					class="required digits"  type="text"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">备注:</label>
			<div class="controls">
				<textarea name="remarks" rows="3" maxlength="200"
					class="input-xlarge">${dict.remarks!''}</textarea>
			</div>
		</div>
		<div class="form-actions">
			<@wolfking.hasPermission code="sys:dict:edit">
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存" />&nbsp; 
			</@wolfking.hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="goback()" />
		</div>
	</form>
</body>
</html>